package com.atguigu.system.controller;

import com.atguigu.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@Api(tags = "权限控制系统登录接口")
@RestController
@RequestMapping("/admain/system/index")
public class IndexController {

    @ApiOperation(value = "登录接口")
    @PostMapping("/login")
    public Result login(){
        Map<String, Object> map = new HashMap<>();
        map.put("token","admin-token");
        return Result.ok(map);
    }
    @ApiOperation(value = "登录后的首界面")
    @GetMapping("/getInfo")
    public Result getInfo(){
        Map<String, Object> map = new HashMap<>();
        map.put("roles","[admin]");
        map.put("name","胡新玉");
        map.put("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
        return Result.ok(map);
    }

    @ApiOperation(value = "登出/注销接口")
    @PostMapping("/logout")
    public Result logout(){
        String str="13vgxzbzcb2";
        return Result.ok();
    }

}
